package com.youyi.yychosesdk.ui.widget;

import android.content.Context;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;

public class PressedImageView extends AppCompatImageView {
    private float scaleSize = 0.97f;

    public PressedImageView(Context context) {
        super(context);
    }

    public PressedImageView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public PressedImageView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
    }

    public void setPressed(boolean z) {
        super.setPressed(z);
        if (isPressed()) {
            setScaleX(this.scaleSize);
            setScaleY(this.scaleSize);
            return;
        }
        setScaleX(1.0f);
        setScaleY(1.0f);
    }

    public void setScaleSize(float f) {
        this.scaleSize = f;
    }
}
